package net.techwatch.jpa.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Entity
public class Job {

	private long id;
	private String code;
	private String grade;
	private Country country;
	private String title;
	private long minSalary;
	private long maxSalary;
	private String requirements;
	private String languageRequest;
	
	public Job() {
		// nothing to do
	}

	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="JOB_ID", nullable=false)
	public long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	private void setId(long id) {
		this.id = id;
	}

	/**
	 * @return the code
	 */
	@Basic(optional=false)
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the grade
	 */
	@Basic(optional=false)
	public String getGrade() {
		return grade;
	}

	/**
	 * @param grade the grade to set
	 */
	public void setGrade(String grade) {
		this.grade = grade;
	}

	/**
	 * @return the country
	 */
	@OneToOne
	@JoinColumn(name="COUNTRY", nullable=true, referencedColumnName="COUNTRY_ID")
	public Country getCountry() {
		return country;
	}

	/**
	 * @param country the country to set
	 */
	public void setCountry(Country country) {
		this.country = country;
	}

	/**
	 * @return the title
	 */
	@Basic(optional=false)
	public String getTitle() {
		return title;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the minSalary
	 */
	@Basic(optional=false)
	public long getMinSalary() {
		return minSalary;
	}

	/**
	 * @param minSalary the minSalary to set
	 */
	public void setMinSalary(long minSalary) {
		this.minSalary = minSalary;
	}

	/**
	 * @return the maxSalary
	 */
	@Basic(optional=false)
	public long getMaxSalary() {
		return maxSalary;
	}

	/**
	 * @param maxSalary the maxSalary to set
	 */
	public void setMaxSalary(long maxSalary) {
		this.maxSalary = maxSalary;
	}

	/**
	 * @return the requirements
	 */
	@Basic(optional=false)
	public String getRequirements() {
		return requirements;
	}

	/**
	 * @param requirements the requirements to set
	 */
	public void setRequirements(String requirements) {
		this.requirements = requirements;
	}

	/**
	 * @return the languageRequest
	 */
	@Column(name="LANGUAGE_REQUEST", nullable=false)
	public String getLanguageRequest() {
		return languageRequest;
	}

	/**
	 * @param languageRequest the languageRequest to set
	 */
	public void setLanguageRequest(String languageRequest) {
		this.languageRequest = languageRequest;
	}
}
